
<%@page import="java.util.Locale"%>
<%@page import="com.jimet.objects.FilterParamsNew"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%
response.setContentType("text/html;charset=UTF-8"); //$NON-NLS-1$
request.setCharacterEncoding("UTF-8"); //$NON-NLS-1$
response.setLocale(new java.util.Locale("tr", "TR")); //$NON-NLS-1$ //$NON-NLS-2$
response.setCharacterEncoding("UTF-8"); //$NON-NLS-1$

String firmSelectedId = request.getParameter("selectedFirmId");
if(firmSelectedId == null) firmSelectedId = "-1";

	String code			= "0";
	String message		= "0";
	String pagePath 	=  "";
	String divId 		=  "";
	String [] paramNames 		= request.getParameterValues("paramName");
	FilterParamsNew filter = ((FilterParamsNew)session.getAttribute("filterNew"));
	
	if( filter == null )
	{
		code 		= "-1";
		message		= "Filtre parametrelerinde sorun var!";
	}
	else
	{
	
		pagePath = filter.getPage();
		divId 	= filter.getDivId();
		
		if( paramNames == null )
		{
			filter.setPage("","");
			filter.setStrFilterValues("");
		}
		else
		{
			for( int i = 0 ; i < paramNames.length ; i ++ )
			{
				String paramName 	= paramNames[i];
				if(paramName.endsWith("_op") || paramName.endsWith("_text"))
					continue;
				
				String paramValue 	= request.getParameter(paramName);
				String paramOp	 	= request.getParameter(paramName+"_op")==null?"=":request.getParameter(paramName+"_op");
				String paramText 	= request.getParameter(paramName+"_text")==null?paramValue:request.getParameter(paramName+"_text");
				
				if(filter.getParamValue(paramName) != null){
					if ( paramOp.equals("LIKE") )
						filter.overrideParamValue(paramName,paramValue.toUpperCase(new Locale("tr","TR")));
					else
						filter.overrideParamValue(paramName,paramValue);
					filter.overrideParamOperator(paramName,paramOp);
					filter.overrideParamText(paramName,paramText);
				}
			}
		}
	}

%>&resultCode=<%=code%>&resultMsg=<%=message%>&divId=<%=divId%>&pagePath=<%=pagePath%>&selectedFirmId=<%=firmSelectedId%>